﻿using System.Windows;
using System.Windows.Controls;
using SpectrumAnalyser.Controls.Wpf.Helpers;
using SpectrumAnalyser.Shell.Helpers;

namespace SpectrumAnalyser.Shell.Controls
{
    /// <summary>
    /// Interaction logic for ProgressControl.xaml
    /// </summary>
    public partial class ProgressControl : UserControl
    {
        public ProgressControl()
        {
            InitializeComponent();
        }

        public void ReportProgress(int progress)
        {
            if (progress == 0)
            {
                Visibility = Visibility.Visible;
                UIHelper.ForceUIToUpdate();
            }

            FileProcessingProgress.Value = progress;
            UIHelper.ForceUIToUpdate();

            if (progress == 100)
            {
                Visibility = Visibility.Collapsed;
                UIHelper.ForceUIToUpdate();
            }
        }
    }
}
